package com.ymatou.iapi.productsnapshot.testcase;

import java.util.Date;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.productsnapshot.parameter.GetProductSnapshotListByTimeBean;
import com.ymatou.iapi.productsnapshot.service.GetProductSnapshotListByTimeCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;
/**
*根据商品ID和开始结束时间获取快照
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetProductSnapshotListByTime{
	private static GetProductSnapshotListByTimeBean getproductsnapshotlistbytimeBean;
	private static GetProductSnapshotListByTimeCall getproductsnapshotlistbytimeCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("根据商品ID和开始结束时间获取快照");
	}

	@Before
	public void caseUp() {
		getproductsnapshotlistbytimeBean=new GetProductSnapshotListByTimeBean();
		getproductsnapshotlistbytimeCall=new GetProductSnapshotListByTimeCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getproductsnapshotlistbytimeCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetProductSnapshotListByTime_001() {
		Logger.start(true,"根据商品ID和开始结束时间获取快照");
		try {
			
			//TODO 补全case代码
			getproductsnapshotlistbytimeBean.setProductId(EnvSetup.getData("productsnapshot_pid1"));
			getproductsnapshotlistbytimeBean.setStartTime(EnvSetup.getData("productsnapshot_timebetween"));
			getproductsnapshotlistbytimeBean.setEndTime(EnvSetup.getData("productsnapshot_timeafter"));

			getproductsnapshotlistbytimeCall.setData(getproductsnapshotlistbytimeBean);
			getproductsnapshotlistbytimeCall.callService();			
			Logger.verifyEquals("200", getproductsnapshotlistbytimeCall.getString("Code"),"验证Code");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}